
package com.ysh.gsm;

import java.io.Serializable;



import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import javax.persistence.ManyToOne;
import javax.persistence.JoinColumn;

import javax.persistence.Table;


/**
 * @author ysh
 *
 */
@Entity()
@Table(name = "call_leg")
@NamedQueries( {
	@NamedQuery(name = "cleg.call", query = "select cl from Callleg cl where cl.call= :call ORDER BY cl.startTime")
})

public class Callleg implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7697829858240422498L;


	private int bscId;
	
	private int cellId;
	
	
	private int startTime;
	
	private short startTimeExt;
	
	private int endTime;
	
	private short endTimeExt;
	
	private byte cArfcn;
	
	private short dArfcn;
	
	private short dchTimeSlot;
	
	private short dchchannelId;

	
	private int handover;
	
	private long callDuration;
	
	private String fileName;
	
	private int fileOffset;
	
	private int fileObjectSize;	
	private TimeDimension timeDimension;
	private Call call;
	private Long callLegKey;  
	


	public Callleg(){
		super();
	}
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "callleg_id")
	public Long getCallLegKey() {
		return callLegKey;
	}
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "call_key", referencedColumnName = "call_key",nullable = false)
	public Call getCall() {
		return call;
	}

	public void setCall(Call call) {
		this.call = call;
	}

	public void setCallLegKey(Long callLegKey) {
		this.callLegKey = callLegKey;
	}
	@Column(name = "bsc_id")
	public int getBscId() {
		return bscId;
	}

	public void setBscId(int bscId) {
		this.bscId = bscId;
	}
	@Column(name = "cell_id")
	public int getCellId() {
		return cellId;
	}

	public void setCellId(int cellId) {
		this.cellId = cellId;
	}

	@Column(name = "start_time")
	public int getStartTime() {
		return startTime;
	}

	public void setStartTime(int startTime) {
		this.startTime = startTime;
	}
	@Column(name = "start_time_ext")
	public short getStartTimeExt() {
		return startTimeExt;
	}

	public void setStartTimeExt(short startTimeExt) {
		this.startTimeExt = startTimeExt;
	}
	@Column(name = "end_time")
	public int getEndTime() {
		return endTime;
	}

	public void setEndTime(int endTime) {
		this.endTime = endTime;
	}
	@Column(name = "end_time_ext")
	public short getEndTimeExt() {
		return endTimeExt;
	}

	public void setEndTimeExt(short endTimeExt) {
		this.endTimeExt = endTimeExt;
	}

	@Column(name = "handover")
	public int getHandover() {
		return handover;
	}

	public void setHandover(int handover) {
		this.handover = handover;
	}
	@Column(name = "call_duration")
	public long getCallDuration() {
		return callDuration;
	}

	public void setCallDuration(long callDuration) {
		this.callDuration = callDuration;
	}
	@Column(name = "file_name")
	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	@Column(name = "file_offset")
	public int getFileOffset() {
		return fileOffset;
	}

	public void setFileOffset(int fileOffset) {
		this.fileOffset = fileOffset;
	}
	@Column(name = "file_object_size")
	public int getFileObjectSize() {
		return fileObjectSize;
	}

	public void setFileObjectSize(int fileObjectSize) {
		this.fileObjectSize = fileObjectSize;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "time_key", referencedColumnName = "time_key",nullable = false)
	public TimeDimension getTimeDimension() {
		return timeDimension;
	}

	public void setTimeDimension(TimeDimension timeDimension) {
		this.timeDimension = timeDimension;
	}

	@Column(name = "ccch_arfcn")
	public byte getcArfcn() {
		return cArfcn;
	}
	public void setcArfcn(byte cArfcn) {
		this.cArfcn = cArfcn;
	}
	@Column(name = "dch_arfcn")
	public short getdArfcn() {
		return dArfcn;
	}
	public void setdArfcn(short dArfcn) {
		this.dArfcn = dArfcn;
	}
	@Column(name = "dch_timeslot")
	public short getDchTimeSlot() {
		return dchTimeSlot;
	}
	public void setDchTimeSlot(short dchTimeSlot) {
		this.dchTimeSlot = dchTimeSlot;
	}
	@Column(name = "dch_channel_code")
	public short getDchchannelId() {
		return dchchannelId;
	}
	public void setDchchannelId(short dchchannelId) {
		this.dchchannelId = dchchannelId;
	}
	
	

}
